<template>
  <div>
<!--    填写处理建议之前展示的界面-->
    <el-card
             style="width: 900px;height: 700px;box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);border-radius: 20px;">
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <div style="margin-top: 20px">
          <el-form-item label="是否同意该结果" prop="note8"  >
            <el-select  :disabled="disabled"  clearable  v-model="form.note8" placeholder="请选择是否同意意处理结果">
              <el-option
                v-for="item in tongtiStatus"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="原因(选填)" prop="handlingOpinions">
            <el-input
              :disabled="disabled"
              type="textarea"
              :rows="20"
              resize="none"
              placeholder="请输入原因"
              maxlength="500"
              show-word-limit
              v-model="form.note9">
            </el-input>
          </el-form-item>
          <div class="line"/>
          <el-form-item>
            <div style="text-align: right">
              <el-button  :disabled="disabled"  type="primary" @click.prevent.native="tijiao" >提 交</el-button>
            </div>
          </el-form-item>
        </div>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import {getReport, zhurenReportYijian} from "@/api/module/shao/shijian/report";
  export default {
    name: "Report",
    // 引入字典
    dicts: ['he_severity_of_injury', 'he_event_severity', 'he_education', 'he_patient_gender', 'he_party_post', 'he_report_event_state', 'he_report_event_type', 'he_patient_age_grades', 'he_event_severity', 'he_review_status', 'he_report_status', 'he_position', 'he_event_classification', 'he_review_event_type', 'he_possibility_of_dispute', 'he_patient_involved', 'he_analyze_reports', 'he_fallback_status', 'he_occurrence_time_period', 'he_event_determinatione', 'he_situation_measures_event', 'he_patient_education_level', 'he_diagnosis_category', 'he_years_of_experience', 'he_severity_of_injury', 'he_reporting_method', 'he_patient_nursing_level', 'he_date_type', 'he_invalidation_status', 'he_patient_ethnic_group', 'he_category', 'he_handling_status'],
    props: ['disabled'],
    data() {
      return {
        tongtiStatus: [{
          value: '01',
          label: '同意'
        }, {
          value: '02',
          label: '不同意'
        }],
        // 表单参数
        form: {
          note8:null,
          note9:null
        },
        rules:{
          //限制体温
          note8: [
            {required: true, message: "不能为空", trigger: "change"},
          ],
        }
      };
    },
    created() {
      getReport(this.$route.query.id).then(response => {
        this.form = response.data;
      });
    },
    methods: {
      // 提交按钮事件
      tijiao() {
        //验证体征表单中的内容
        this.$refs["form"].validate(valid => {
          if (valid) {
            //重新写后台方法由于这个操作需要同时新增两张表
            zhurenReportYijian(this.form).then(response => {
              this.$modal.msgSuccess("主任意见填写成功");
              const obj = {path: "/hosipitalevent/zhurenchuli?value1=true&type=" + this.form.reviewEventType + "&state=01"};
              this.$tab.closeOpenPage(obj);
              //this.$router.push({path: "/index"});
            });
          }})
      },
    }
  };
</script>
